package com.xhs.main.service.cwb.impl;

import com.xhs.main.dao.cwb.CwbDepartmentDao;
import com.xhs.main.entity.cwb.CwbDepartment;
import com.xhs.main.service.cwb.CwbDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CwbDepartmentServiceImpl implements CwbDepartmentService {


    @Autowired
    CwbDepartmentDao cwbDepartmentDao;

    @Override
    public void insertCwbDepartment() {
        CwbDepartment cwbDepartment = new CwbDepartment(2,"8848","物资部",200.00,
                "2020-09-12","2020-09-13",1,
                "李飞","冷建伟");
        cwbDepartmentDao.insertCwbDepartment(cwbDepartment);
    }

    @Override
    public List<CwbDepartment> selectAllCwbDepartment() {
        List<CwbDepartment> CwbDepartments = cwbDepartmentDao.selectAllCwbDepartment();
        return CwbDepartments;
    }

    @Override
    public CwbDepartment selectOneByID(Integer cwbDId) {
        CwbDepartment cwbDepartment = cwbDepartmentDao.selectOneByID(cwbDId);
        return cwbDepartment;
    }

    @Override
    public Double selectAllMoney() {
        Double money = cwbDepartmentDao.selectAllMoney();
        return money;
    }

    @Override
    public Integer getAllApprover() {
        Integer AllApprover =  cwbDepartmentDao.selectAllApprover();
        return AllApprover;
    }

    @Override
    public Integer getAllNoApprover() {
        Integer AllNoApprover =  cwbDepartmentDao.selectAllNoApprover();
        return AllNoApprover;
    }
}
